package com.ajieee.merge.controller.finance;

import com.ajieee.merge.entity.common.result.ApiResult;
import com.ajieee.merge.entity.finance.Quote;
import com.ajieee.merge.service.QuoteService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ajieee
 * @date 2025-11-02
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/quote")
public class QuoteController {

	private final QuoteService quoteService;

	@GetMapping("/{targetCode}")
	public ApiResult<List<? extends Quote>> list(@PathVariable String targetCode) {
		List<? extends Quote> quotes = quoteService.queryQuotesByTargetCode(targetCode);
		return ApiResult.success(quotes);
	}

}
